Managing volumes
How to mount, unmount and delete a volume with the CGC CLI.
Mount volume
If you didn't mount your volume to the compute resource during the creation process, you can do it manually by using this command
cgc volume mount <volume_name> -t <name of compute resource>
t- target (use thecompute createname where you want to mount the volume)
Volume will be mounted in a default path curated for the template (for nvidia-pytorch it is /workspace/<volume_name>), if you want to mount it elsewhere, use the -sp or -fp option.
example:
cgc volume mount getting-started -t getting-jupyter
Mounting a volume will reload the compute resources it will be mounted to.
Do you want to continue? (Y/N): Y
Volume getting-started successfully mounted to getting-jupyter, mount path: /workspace/getting-started.
Mounting a volume requires restarting the compute resource to which the volume will be mounted. Any data stored on the ephemeral (temporary) disk storage will be lost. Before mounting the volume, make sure you have saved all the data you want to keep. Data stored on volumes will not be lost.
Umount volume
To umount your volume from every compute resource type:
cgc volume umount <name>
example:
cgc volume umount getting-started
Unmounting a volume will reload all compute resources it was mounted to
Do you want to continue? (Y/N): Y
Volume getting-started successfully unmounted from selected apps.
Unmounting a volume requires restarting all compute resources to which the volume was mounted. Any data stored on the ephemeral (temporary) disk storage will be lost. Before unmounting the volume, make sure you have saved all the data you want to keep. Data stored on volumes will not be lost.
Volume delete
Same as a compute resource, you can delete a volume by using the following command. Be careful though, as those usually contain your data that usually needs persistance
cgc volume delete <name>
example:
cgc volume delete getting-started
Volume getting-started deleted.